projects
/
emacs.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
9eb028f
)
Fix use-after-close in connect_network_socket
author
Paul Eggert
<eggert@cs.ucla.edu>
Thu, 21 Jul 2016 09:27:55 +0000
(11:27 +0200)
committer
Paul Eggert
<eggert@cs.ucla.edu>
Thu, 21 Jul 2016 09:29:43 +0000
(11:29 +0200)
* src/process.c (connect_network_socket): Don’t use
external_sock_fd after closing it. Problem found by Coverity Scan.
src/process.c
patch
|
blob
|
history
diff --git
a/src/process.c
b/src/process.c
index bdbdefabb64513a5e51d84f00c3b66243451db41..bc2ac451c9df6e742d9beedac2873c254eb67e25 100644
(file)
--- a/
src/process.c
+++ b/
src/process.c
@@
-3185,6
+3185,8
@@
connect_network_socket (Lisp_Object proc, Lisp_Object addrinfos,
xerrno = errno;
emacs_close (s);
s = -1;
+ if (socket_to_use < 0)
+ break;
continue;
}
}
@@
-3312,6
+3314,8
@@
connect_network_socket (Lisp_Object proc, Lisp_Object addrinfos,
specpdl_ptr = specpdl + count1;
emacs_close (s);
s = -1;
+ if (socket_to_use < 0)
+ break;
#ifdef WINDOWSNT
if (xerrno == EINTR)